home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / ValueNS.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  4.8 KB  |  210 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: ValueNS.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODValueNameSpace_xh
  18. #define SOM_ODValueNameSpace_xh
  19.  
  20. class ODValueNameSpace;
  21.  
  22. #define ODValueNameSpace_MajorVersion 1
  23. #define ODValueNameSpace_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODNameSpace_xh
  31. #include <NamSpac.xh>
  32. #endif
  33.  
  34. #ifndef ODValueNameSpace_API
  35. #define ODValueNameSpace_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODNameSpace;
  50. class ODStorageUnitView;
  51. class ODValueNameSpace;
  52. class ODValueIterator;
  53.  
  54. /*
  55.  * End of user-defined types.
  56.  */
  57.  
  58. #ifdef OLDIBMSOMAPISUPPORT
  59. #define ODValueNameSpaceCClassData ODValueNameSpaceClassData
  60. #define ODValueNameSpaceNewClass(major,minor) somNewVersionedClassReference(ODValueNameSpace,major,minor)
  61. #endif
  62.  
  63. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  64. #define ODValueNameSpaceMetaClass SOMClass
  65.  
  66. #if PRAGMA_ALIGN_SUPPORTED
  67. #  pragma options align=power
  68. #endif
  69.  
  70. /* The API to the ODValueNameSpace class object, and the methods it introduces. */
  71. SOMEXTERN struct ODValueNameSpaceClassDataStructure {
  72. #ifdef OLDIBMSOMAPISUPPORT
  73.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  74. #else
  75.     long zero;
  76. #endif
  77.     somStaticClassInfo *sci;
  78.     somDToken        instanceDataToken;
  79.     long reserved [3];
  80.     somMToken Register;
  81.     somMToken GetEntry;
  82.     somMToken CreateIterator;
  83.     somMToken reserved1;
  84.     somMToken reserved2;
  85.     somMToken reserved3;
  86. } SOMDLINK ODValueNameSpaceClassData;
  87.  
  88. #if PRAGMA_ALIGN_SUPPORTED
  89. #  pragma options align=reset
  90. #endif
  91.  
  92. #if !defined(ODValueNameSpace_Class_Source) && !defined(SOM_Module_valuens_Source)
  93. #if PRAGMA_IMPORT_SUPPORTED
  94. #pragma import list ODValueNameSpaceClassData
  95. #endif
  96. #endif
  97.  
  98.  
  99. /*
  100.  * -- Typedefs and inline method declarations for left path inherited methods
  101.  * -- are omitted because this compilation had -museinheritedmethods in effect
  102.  */
  103.  
  104.  
  105. /*
  106.  * -- Typedefs for ODValueNameSpace Method Procedures
  107.  */
  108. SOMEXTERN {
  109. typedef void   (* SOMLINK somTD_ODValueNameSpace_Register)(ODValueNameSpace *somSelf, Environment *ev,
  110.         ODISOStr key,
  111.         ODByteArray* value);
  112. typedef ODBoolean   (* SOMLINK somTD_ODValueNameSpace_GetEntry)(ODValueNameSpace *somSelf, Environment *ev,
  113.         ODISOStr key,
  114.         ODByteArray* value);
  115. typedef ODValueIterator*   (* SOMLINK somTD_ODValueNameSpace_CreateIterator)(ODValueNameSpace *somSelf, Environment *ev);
  116. }
  117.  
  118. #endif /* ODValueNameSpace_API */
  119.  
  120.  
  121. /*
  122.  * -- This emitter treats Method Tokens as Thunks by default.
  123.  * -- Use the sc modifier "nothunks" to change this default
  124.  */
  125. #undef somresolve_
  126. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  127.  
  128. /*
  129.  * -- The C++ Wrapper Class for ODValueNameSpace
  130.  */
  131. class ODValueNameSpace : public ODNameSpace
  132. {
  133. public:
  134.  
  135. // ODValueNameSpace::new registers use of the class object, and then uses somNew
  136. // to allocate memory and load the object method table pointer. 
  137. void *operator new(size_t size)
  138. {
  139.     SOM_IgnoreWarning(size);
  140.     // Allocate memory using the default allocator for ODValueNameSpace, and
  141.     // clear mem & set method table pointer, call basic initialization
  142. #ifdef SOMCHKNULL
  143.     void * __somResult = (void *)
  144.       somNewObject(ODValueNameSpace);
  145.     SOMCHKNULL(__somResult);
  146.     return __somResult;
  147. #else
  148.     return (void*) somNewObject(ODValueNameSpace);
  149. #endif
  150. }
  151.  
  152. // ODValueNameSpace::delete uses the default deallocator for the object's class.
  153. void operator delete(void * obj)
  154. {
  155.     if (obj) {
  156.         SOM_Resolve(obj,SOMObject,somFree)
  157.            ( (SOMObject*) obj );
  158.     }
  159. }
  160.  
  161. /* method: Register */
  162. void   Register(Environment *ev,
  163.         ODISOStr key,
  164.         ODByteArray* value)
  165. {
  166.    SOM_ResolveD(this,ODValueNameSpace,ODValueNameSpace,Register)
  167.     (this,ev,key,value);
  168. #ifdef SOMCHKEXCEPT
  169.       SOMCHKEXCEPT;
  170. #endif
  171. }
  172.  
  173. /* method: GetEntry */
  174. ODBoolean   GetEntry(Environment *ev,
  175.         ODISOStr key,
  176.         ODByteArray* value)
  177. {
  178.    #ifdef SOMCHKEXCEPT
  179.    ODBoolean __somResult = 
  180.       SOM_ResolveD(this,ODValueNameSpace,ODValueNameSpace,GetEntry)
  181.     (this,ev,key,value);
  182.       SOMCHKEXCEPT;
  183.    return __somResult;
  184. #else
  185.    return SOM_ResolveD(this,ODValueNameSpace,ODValueNameSpace,GetEntry)
  186.     (this,ev,key,value);
  187. #endif
  188. }
  189.  
  190. /* method: CreateIterator */
  191. ODValueIterator*   CreateIterator(Environment *ev)
  192. {
  193.    #ifdef SOMCHKEXCEPT
  194.    ODValueIterator* __somResult = 
  195.       SOM_ResolveD(this,ODValueNameSpace,ODValueNameSpace,CreateIterator)
  196.     (this,ev);
  197.       SOMCHKEXCEPT;
  198.    return __somResult;
  199. #else
  200.    return SOM_ResolveD(this,ODValueNameSpace,ODValueNameSpace,CreateIterator)
  201.     (this,ev);
  202. #endif
  203. }
  204.  
  205. };   /* ODValueNameSpace */
  206.  
  207.  
  208.  
  209. #endif       /* SOM_ODValueNameSpace_xh */
  210.